package com.aifund.app.service.impl;

import com.aifund.app.service.UserFollowRobotService;
import com.aifund.common.dao.UserFollowRobotDao;
import com.aifund.common.enums.DocumentaryInfo.FollowOrderEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserFollowRobotServiceImpl implements UserFollowRobotService {

    @Autowired
    UserFollowRobotDao userFollowRobotDao;
    @Override
    public int getCountForRobot(Long robotId) {
        Integer countByRobotIdAndStatus = userFollowRobotDao.getCountByRobotIdAndStatus(robotId, FollowOrderEnum.FOLLOWING.getStatus());
        return countByRobotIdAndStatus != null?countByRobotIdAndStatus:0;
    }
}
